package vn.smartoffice.promail.services.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import vn.smartoffice.promail.entity.MailItem;
import vn.smartoffice.promail.mapper.MailItemMapper;
import vn.smartoffice.promail.services.BaseService;
import vn.smartoffice.promail.services.MailItemService;

@Service("mailItemService")
@Transactional
public class MailItemServiceImpl extends BaseService<MailItem, MailItemMapper> implements MailItemService {

	@Autowired
	public MailItemServiceImpl(MailItemMapper mapper) {
		super(mapper);
	}

	@Override
	public List<MailItem> findByUserFolderId(long userId, long folderId) {
		return mapper.findByUserFolderId(userId, folderId);
	}

	@Override
	public List<MailItem> findByTitle(String keyword) {
		return mapper.findByTitle(keyword);
	}

	@Override
	public void deleteByUserFolderId(long userId, long folderId) {
		mapper.deleteByUserFolderId(userId, folderId);
	}

}
